package com.lazycat.backend.controller.chat;

import com.lazycat.backend.service.chat.GetGroupMessagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class GetGroupMessageController {
    @Autowired
    private GetGroupMessagesService getGroupMessagesService;

    @PostMapping("chat/getGroupMessage/")
    public HashMap<String, Object> get(@RequestBody Map<String, String> map) {
        Integer group_id = Integer.parseInt(map.get("group_id"));
        return getGroupMessagesService.get(group_id);
    }


}
